<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<% String basePath = request.getContextPath(); %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>


<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>找回密码</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="<%=basePath%>/resources/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="<%=basePath%>/resources/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="<%=basePath%>/resources/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="<%=basePath%>/resources/assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="<%=basePath%>/resources/assets/css/app.css">
    <link href="<%=basePath%>/resources/css/mui/mui.min.css" rel="stylesheet" />
    
    <script src="<%=basePath%>/resources/assets/js/jquery.min.js"></script>

</head>

<body data-type="login">
    <script src="<%=basePath%>/resources/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <div class="tpl-login">
            <div class="tpl-login-content">
                <div class="tpl-login-title">找回密码</div>
				<span class="tpl-login-content-info">
				                <br>
                </span>


                <form class="am-form tpl-form-line-form" id='register-form' action=""  method="post" >

                    <div class="am-form-group">
                       <input type="text" class="tpl-form-input" id="userName" name = "userName"  placeholder="姓名">
                    </div>

                    <div class="am-form-group">
                        <input type="text" class="tpl-form-input" name = "phone" id="userPhone" placeholder="电话">
                    </div>

                    <div class="am-form-group">
                        <button type="submit" class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn" >提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="<%=basePath%>/resources/assets/js/amazeui.min.js"></script>
    <script src="<%=basePath%>/resources/assets/js/app.js"></script>
    
	<script src="<%=basePath%>/resources/js/mui/mui.min.js"></script>
	<script  src="<%=basePath%>/resources/js/jquery-1.9.0/jquery.min.js"></script>
    <script>
			function verification(){
				debugger;
				var result=false;
				var phoneReg = /^1[3458]\d{9}$/;
				var phoneVal = $('#userPhone').val();
				
				if($('#userName').val().length<=0){
					mui.alert("姓名不能为空！",'提示');
					return result;
				} 
				
				if (!phoneReg.exec(phoneVal)){
					 mui.alert("请输入正确的手机号！",'提示');
					 return result;
				}
				
				/* if(pass.length<=0){
					mui.alert("密码不能为空！",'提示');
					return result;
				}
				if(passOne.length<=0){
					mui.alert("请输入确认密码！",'提示');
					return result;
				}else{
					if(pass!==passOne){
						mui.alert("两次密码输入不一致！！",'提示');
						return result;
					}
				} */
				
 			   if(!result){
					 mui.ajax('${ctx}/user/isPhone',{
						data:{"userName":$('#userName').val(),"phone":phoneVal},
						dataType:'json',
						type:'post',
						async:false,
						success:function(data){
							if(data==0 || data=="0"){
								result = true ;
							}else{
								mui.alert(data,'提示');
							}
						}
					});  
					return true;
				}
				
			 }
			
			
		</script>

</body>
	
</html>
